package com.example;

import com.example.strategy.PaymentContext;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class App {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(App.class, args);
        PaymentContext paymentContext = context.getBean(PaymentContext.class);

        paymentContext.executePayment("creditCard", 100.0);
        // paymentContext.executePayment("paypal", 50.0);
        paymentContext.getPayment("paypal").pay(50.0);
    }
}
